package com.spring.application;

import com.java.bean.Person;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ApplicationObjectSupport;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringIOCConfApp_01 {

    @Test
    public void getBeanNUll(){
        ApplicationContext context = new ClassPathXmlApplicationContext("springIOC-conf-01.xml");
        Person person = context.getBean( Person.class);
        System.out.println(person);
    }

    @Test
    public void getBeanRef(){
        ApplicationContext context = new ClassPathXmlApplicationContext("springIOC-conf-01.xml");
        Person person = context.getBean("person02", Person.class);
        System.out.println(person);
    }

    @Test
    public void getBeanList(){
        ApplicationContext context = new ClassPathXmlApplicationContext("springIOC-conf-01.xml");
        Person person03 = context.getBean("person03", Person.class);
        System.out.println(person03);
    }

    @Test
    public void getBeanMap(){
        ApplicationContext context = new ClassPathXmlApplicationContext("springIOC-conf-01.xml");
        Person person04 = context.getBean("person04", Person.class);
        System.out.println(person04);
    }

    @Test
    public void getBeanProperties(){
        ApplicationContext context = new ClassPathXmlApplicationContext("springIOC-conf-01.xml");
        Person person05 = context.getBean("person05", Person.class);
        System.out.println(person05);
    }

    @Test
    public void getBeanUtil(){
        ApplicationContext context = new ClassPathXmlApplicationContext("springIOC-conf-01.xml");
        Person person05 = context.getBean("person06", Person.class);
        System.out.println(person05);
    }

    @Test
    public void getBeanJILian(){
        ApplicationContext context = new ClassPathXmlApplicationContext("springIOC-conf-01.xml");
        Person person05 = context.getBean("person07", Person.class);
        System.out.println(person05);
    }




}
